﻿using System.Collections.Generic;
using ProtoBuf;
namespace PnJ.Aliyun.OTS.Models
{
    /// <summary>
    /// 删除一行数据
    /// </summary>
    [ProtoContract(Name = "DeleteRowRequest")]
    public class DeleteRowRequest
    {
        public DeleteRowRequest()
        {

        }
        public DeleteRowRequest(string tableName,Condition condition,List<Column> primaryKey)
        {
            this.TableName = tableName;
            this.Condition = condition;
            this.PrimaryKey = primaryKey;
        }
        private List<Column> primaryKey = new List<Column>();
        /// <summary>
        /// 请求更新数据的表名
        /// </summary>
        [ProtoMember(1, Name = "table_name", IsRequired = true)]
        public string TableName { get; set; }
        /// <summary>
        /// 在数据更新前是否进行存在性检查
        /// </summary>
        [ProtoMember(2, Name = "condition", IsRequired = true)]
        public Condition Condition { get; set; }
        /// <summary>
        /// 请求更新的行全部的主键列
        /// </summary>
        [ProtoMember(3, Name = "primary_key", IsRequired = true)]
        public List<Column> PrimaryKey { get { return primaryKey; } set { primaryKey = value; } }
    }
}
